#include <iostream>
#include <string>

int main()
{
    std::string str;
    std::cin >> str;

    int idx = 0;
    char min_c = str[0];
    for (int i = 1; i < str.size(); i++)
    {
        if (str[i] < min_c)
        {
            idx = i;
            min_c = str[i];
        }
    }

    str[idx] = str[0];
    str[0] = min_c;

    std::cout << str << std::endl;
    return 0;
}